print("------欢迎进入坑爹游戏-----")
username = input("请输入用户名: ")
while True:
	money = int(input("请充值游戏币: "))
	if money %100 == 0:
		bi = money/100*30
		print("充值成功,获得{}个币".format(bi))
		break
	else:
		print("请重新充值")


print("开始猜数字大小游戏")
while True:
	
	ran1 = random.randint(1,6)
	ran2 = random.randint(1,6)
	num = input("请输入大小large/small: ")
	if ((ran1+ran2)>6 and num=='large') or ((ran1+ran2)<=6 and num=='samll'):
		bi -=20
		print("猜对了，奖励一个币")
		bi +=1
		print("剩余币数", bi)

		
	else:
		bi-=20
		print("猜错了")
		print("剩余币数", bi)
	continue_1 = input("是否继续游戏y/n：")
	if continue_1 != 'y':
		break
	if bi - 20<0:
		print('余额不足请充值')
		while True:
			money = int(input("请充值游戏币: "))
			if money %100 == 0:
				bi = money/100*30+bi
				print("充值成功,获得{}个币".format(bi))
				break
			else:
				print("请重新充值")

